<template>
  <div class="details">
    <p class="title">用户管理/车主档案详情</p>
    <div class="detail-content">
      <div class="content-title">
        <ul class="card-detail">
          <li>
            <span>姓名：{{ data.uname }}</span
            ><span>电话：{{ data.tel }}</span>
          </li>
          <li>身份证号码：{{ data.cid }}</li>
        </ul>
      </div>
      <hr />
      <div class="card-detal">
        <p>身份信息：</p>
        <el-card class="box-card box-card1">
          <div class="card1-1"></div>
          <div class="card1-2"></div>
          <div class="card1-3"></div>
          <div class="card1-4"></div>
          <div class="img1">
            <img src="../assets/u180.png" alt="" />
          </div>
        </el-card>

        <el-card class="box-card box-card1 box-card2">
          <div class="card1-1"></div>
          <div class="card1-2"></div>
          <div class="card1-3"></div>
          <div class="card1-4"></div>
          <div class="img2">
            <img src="../assets/u187.png" alt="" />
          </div>
        </el-card>
      </div>
      <div class="car-detal">
        <p>车辆信息：</p>
        <div class="car-detal-box">
          <div>
            <p>车辆类型：{{ data.type }}</p>
            <el-card class="box-card box-card1">
              <div class="card1-1"></div>
              <div class="card1-2"></div>
              <div class="card1-3"></div>
              <div class="card1-4"></div>
              <div class="img1">
                <img src="../assets/u196.png" alt="" />
              </div>
              <div class="car-info">行驶证信息</div>
            </el-card>
          </div>
          <div>
            <p>行驶证号：{{ data.pid }}</p>
            <el-card class="box-card box-card1 box-card2">
              <div class="card1-1"></div>
              <div class="card1-2"></div>
              <div class="card1-3"></div>
              <div class="card1-4"></div>
              <div class="img2">
                <img src="../assets/u203.png" alt="" />
              </div>
              <div class="car-info">驾驶证照片</div>
            </el-card>
          </div>
          <div>
            <p>
              <span>证件到期时间：{{ data.time }}</span>
              <el-input
                size="mini"
                class="inp"
                v-model="inp"
                placeholder="请输入修改内容"
              ></el-input>
              <button></button>
            </p>
            <el-card class="box-card">
              <div class="car-info">车辆照片</div>
              <div class="img3">
                <img src="../assets/u196.png" alt="" />
              </div>
            </el-card>
          </div>
        </div>
      </div>

      <div class="btn">
        <el-button type="primary" @click="onSubmit">确定</el-button>
        <el-button type="primary" @click="onCancel">取消</el-button>
      </div>
    </div>
  </div>
</template>

<script>
//import api from "../../api";
export default {
  data() {
    return {
      inp: "",
      id: "",
      data: {},
    };
  },
  mounted() {
    this.id = this.$route.params.data;
    //console.log(this.$route.params.data);
    // this.http();
  },
  methods: {
    //请求数据
    // http() {
    //   api
    //     .carfileUpdate({
    //       id: this.id,
    //     })
    //     .then((res) => {
    //       console.log(res.data);
    //       if (res.data.status == 200) {
    //         this.data = res.data.result[0];
    //       }
    //     });
    // },
    //确认修改
    onSubmit() {
    //   api
    //     .detailsUpdate({
    //       id: this.id,
    //       time: this.inp,
    //     })
    //     .then((res) => {
    //       console.log(res.data);
    //       if (res.status == 200) {
    //         console.log("修改成功");
    //         //刷新页面
    //         this.http();
    //         //清空输入框
    //         this.inp = "";
    //       }
    //     });
    },
    //取消修改
    onCancel() {
      this.inp = "";
    },
  },
};
</script>

<style scoped lang='less'>
.details {
  width: 1500px;
  padding-left: 200px;
  padding-top: 10px;
  box-sizing: border-box;

  .title {
    text-align: left;
    font-size: 14px;
  }
  .detail-content {
    padding-left: 20px;
    box-sizing: border-box;
    width: 100%;
    height: 740px;
    background: #eeeeee;
    margin-top: 25px;
    position: relative;

    .content-title {
      padding-top: 40px;
      padding-left: 40px;
      box-sizing: border-box;
      height: 130px;

      .card-detail li {
        text-align: left;
        margin-bottom: 20px;
        span {
          margin-right: 50px;
        }
      }
    }
  }
}
.card-detal {
  margin-top: 15px;
}
.card-detal p,
.car-detal p {
  text-align: left;
}
.car-detal {
  position: absolute;
  top: 385px;
}
.box-card {
  width: 300px;
  height: 170px;
  margin-left: 70px;
  float: left;
  margin-top: 15px;
  padding: 0;
  position: relative;
}
.car-detal-box {
  display: flex;
}
.car-detal-box p {
  text-align: center;
}
.btn {
  position: absolute;
  bottom: 20px;
  margin-left: 400px;
  .el-button {
    margin: 0 50px;
  }
}

.box-card1 div {
  height: 20px;
  background: #eeeeee;
  margin-bottom: 15px;
  .card1-1 {
    width: 140px;
  }
  .card1-2 {
    width: 140px;
  }
  .card1-3 {
    width: 120px;
  }
  .card1-4 {
    width: 270px;
  }
}
.box-card1 .img1 {
  width: 120px;
  height: 110px;
  position: absolute;
  top: 0px;
  right: 5px;
  background: white;
  text-align: center;
  line-height: 110px;
  img {
    width: 100%;
  }
}
.box-card2 {
  text-align: right;
  .img2 {
    opacity: 0.6;
    width: 110px;
    height: 100px;
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    text-align: center;
    line-height: 110px;
    img {
      width: 100%;
    }
  }
  .card1-1 {
    width: 140px;
    margin-left: 130px;
  }
  .card1-2 {
    width: 140px;
    margin-left: 130px;
  }
  .card1-3 {
    width: 120px;
    margin-left: 130px;
  }
}
.img3 {
  width: 260px;
  height: 140px;
  opacity: 0.6;
  img {
    width: 100%;
    height: 100%;
  }
}
.box-card .car-info {
  position: absolute;
  top: 0;
  left: 100px;
  background: white;
  font-size: 14px;
}
.inp {
  width: 120px;
  margin-left: 5px;
}
</style>